package com.example.demo.innoket.util;

/**
 */
public class GeneratorConfig {

	//0:Sequeuece自增；1：UUID随机
	public static final int ID_GENERATE_STRATGE = 0;

	public static final String[] EXCLUDE_COL = new String[] { "id", "deleted", "createTime",
			"creator", "updateTime", "updateBy", "remark" };
	public static enum ModulePath {
//		FINANCE_COMMON_BASE("销巴生活平台","\\com\\core\\dao","\\com\\core\\mappers");
		FINANCE_COMMON_BASE("销巴生活平台","\\com\\common\\finance\\dao","\\com\\common\\finance\\mappers");
//		FINANCE_COMMON_BASE("销巴生活平台","\\com\\common\\pay\\dao","\\com\\common\\pay\\mappers");
		//模块名称
		public String name;
		//项目内Dao相对路劲
		public String daoPath;
		//项目内Mapper相对路劲
		public String mapperPath;

		private ModulePath(String name, String daoPath, String mapperPath) {
			this.name = name;
			this.daoPath = daoPath;
			this.mapperPath = mapperPath;
		}

		public String getPath(FileType type) {
			if (type.getType().equals(FileType.DAO.getType())) {
				return this.daoPath;
			} else if (type.getType().equals(FileType.MAPPER.getType())) {
				return this.mapperPath;
			} else if (type.getType().equals(FileType.ENTITY.getType())) {
				String entityPath = this.daoPath;
//				\com\common\finance\dao
				entityPath = entityPath.replace("dao",FileType.ENTITY.getType());//替换为vo的路径
				return entityPath;
			}else if(type.getType().equals(FileType.CONTROLLER.getType())){
				String entityPath = this.daoPath;
				entityPath = entityPath.replace("dao", FileType.CONTROLLER.getType());//替换为controller路径
				return entityPath;
			}else if(type.getType().equals(FileType.SERVICE.getType())){
				String entityPath = this.daoPath;
				entityPath = entityPath.replace("dao", FileType.SERVICE.getType());//替换为controller路径
				return entityPath;
			}else if(type.getType().equals(FileType.CONFIG.getType())){
				String entityPath = this.daoPath;
				entityPath = entityPath.replace("dao", FileType.CONFIG.getType());//替换为controller路径
				return entityPath;
			}else if(type.getType().equals(FileType.RECEVIER.getType())){
				String entityPath = this.daoPath;
				entityPath = entityPath.replace("dao", FileType.RECEVIER.getType());//替换为controller路径
				return entityPath;
			}else if(type.getType().equals(FileType.SERVICE_IMPL.getType())){
				String entityPath = this.daoPath;
				entityPath = entityPath.replace("dao", "service//impl");//替换为controller路径
				return entityPath;
//			}else if(type.getType().equals(FileType.DUBBOPROVIDER.getType())){
//				String entityPath = this.daoPath;
//				entityPath = entityPath.replace("dao", "provider");
//				return entityPath;
//			}else if(type.getType().equals(FileType.CONTROLLER_API.getType())){
//				return this.daoPath.replace("dao", "controller");
//			}else if(type.getType().equals(FileType.EXPAND.getType())){
//				return this.daoPath.replace("dao", "expand");
//			}else if(type.getType().equals(FileType.JSP_LIST_FILE.getType())){
//				return this.daoPath.replace("dao", "pages");
//			}else if(type.getType().equals(FileType.JS_LIST_FILE.getType())){
//				return this.daoPath.replace("dao", "js");
//			}else if(type.getType().equals(FileType.JS_ADD_FILE.getType())){
//				return this.daoPath.replace("dao", "js");
//			}else if(type.getType().equals(FileType.JS_VIEW_FILE.getType())){
//				return this.daoPath.replace("dao", "js");
//			}else if(type.getType().equals(FileType.JSP_ADD_FILE.getType())){
//				return this.daoPath.replace("dao", "js");
//			}else if(type.getType().equals(FileType.JSP_VIEW_FILE.getType())){
//				return this.daoPath.replace("dao", "js");
			}
			return null;
		}
	}
}
